﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.FactoryManagement;

namespace Digitalmes.Model.FactoryManagement
{
    /// <summary>
    /// 编码项
    /// </summary>
	[Table("EncodeItem")]

    [Display(Name = "_Model.EncodeItem")]
    public class EncodeItem : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._EncodeItem._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._EncodeItem._Pos")]
        [Comment("顺序")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public int? Pos { get; set; }
        [Display(Name = "_Model._EncodeItem._ValueName")]
        [Comment("值名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string ValueName { get; set; }
        [Display(Name = "_Model._EncodeItem._ValueMode")]
        [Comment("值类型")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public ValueTypeEnum? ValueMode { get; set; }
        [Display(Name = "_Model._EncodeItem._Value")]
        [Comment("值")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Value { get; set; }
        [Display(Name = "_Model._EncodeItem._Remark")]
        [Comment("备注")]
        public string Remark { get; set; }
        [Display(Name = "_Model._EncodeItem._Scheme")]
        [Comment("方案")]
        public EncodeScheme Scheme { get; set; }
        [Display(Name = "_Model._EncodeItem._Scheme")]
        [Comment("方案")]
        public long? SchemeId { get; set; }
        [Display(Name = "_Model._EncodeItem._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
